<template>
  <div>
    <el-dialog
      title="题目审核"
      width="400px"
      :visible="dialogShow"
      @close="closeDialog"
    >
      <el-radio v-model="chkState" label="1">通过</el-radio>
      <el-radio v-model="chkState" label="2">拒绝</el-radio>
      <el-input
        v-model="chkRemarks"
        style="margin-top: 30px"
        type="textarea"
        :autosize="{ minRows: 2, maxRows: 4 }"
        placeholder="请输入内容"
      />
      <div slot="footer" class="dialog-footer">
        <el-button @click="closeDialog">取 消</el-button>
        <el-button type="primary" @click="submitProcess"> 确 定 </el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { processApi } from '@/api/queBank'
export default {
  props: {
    dialogShow: {
      type: Boolean,
      default: false
    },
    id: {
      type: Number,
      required: true
    }
  },
  data() {
    return {
      chkState: '1',
      chkRemarks: ''
    }
  },
  methods: {
    closeDialog() {
      this.$emit('update:dialogShow', false)
      this.chkState = '1'
      this.chkRemarks = ''
    },
    // 点击确认
    async submitProcess() {
      const obj = {
        id: this.id,
        chkState: +this.chkState,
        chkRemarks: this.chkRemarks
      }
      await processApi(obj)
      this.$emit('Refresh')
      this.closeDialog()
    }
  }
}
</script>

<style></style>
